# Maintainer:
# Contributor: Filipe Laíns (FFY00) <lains@archlinux.org>
# Contributor: Antonio Rojas <arojas@archlinux.org>

pkgname=jxrlib
pkgver=0.2.4
pkgrel=2
pkgdesc="Open source implementation of jpegxr"
arch=('loong64' 'x86_64')
url="https://archive.codeplex.com/?p=jxrlib"
license=('GPL')
depends=('glibc')
makedepends=('cmake')
source=(https://github.com/glencoesoftware/jxrlib/archive/v$pkgver/$pkgname-$pkgver.tar.gz
        CMakeLists.txt)
sha512sums=('e93fe0fbd63a36f943504f0ebf2e3f2679ec3db8997927c405b8e6310f5b55b6dd5e08cdc2e5bf09681c84da923b8c770f03bf22a21746ff5cef01b4ef8de96a'
            '832557a5aa0825132aefe38f5136159f1d2ac46bf8455745877342e08db5752c73c34f16a7edf3fd5fa8813f1c48a1b5d77d91901301e2322f18b520bbe97ae6')

prepare() {
  cp CMakeLists.txt $pkgname-$pkgver/
}

build() {
  cmake -B build -S $pkgname-$pkgver \
    -DCMAKE_INSTALL_PREFIX=/usr
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build
}
